<!DOCTYPE html>
<html>
<head>
  <title>Test - Object</title>
  <link rel="stylesheet" href="QUnit.css" type="text/css" />
  <script type="text/javascript" src="QUnit.js"></script>
  <script type="text/javascript" src="QUnitExt.js"></script>
</head>
<body>
  <h1 id="qunit-header">Test Results</h1>
  <h2 id="qunit-banner"></h2>
  <h2 id="qunit-userAgent"></h2>
  <ol id="qunit-tests"></ol>
  <br />
  <textarea id="qunit-log" rows="10" cols="100"></textarea>
</body>
<script type="text/javascript" src="..\..\bin\Debug\mscorlib.debug.js"></script>
<script type="text/javascript">
module('Object');
test('clearKeys', function() {
  var d = { 'abc': 123, 'def': 456 };
  var d2 = { };

  QUnit.equal(Object.getKeyCount(d), 2);
  Object.clearKeys(d);
  QUnit.equal(Object.getKeyCount(d), 0);
  Object.clearKeys(d2);
  QUnit.equal(Object.getKeyCount(d2), 0);
});

test('keys', function() {
  var d = { 'abc': 123, 'def': 456 };
  var d2 = { };

  var keys = Object.keys(d);
  var keys2 = Object.keys(d2);

  QUnit.equal(keys.length, 2);
  QUnit.equal(keys.contains('abc'), true);
  QUnit.equal(keys.contains('def'), true);
  QUnit.equal(keys2.length, 0);
});

test('keyExists', function() {
  var d = { 'abc': 123, 'def': 456 };
  var d2 = { };

  QUnit.equal(Object.keyExists(d, 'abc'), true);
  QUnit.equal(Object.keyExists(d, 'ghi'), false);
  QUnit.equal(Object.keyExists(d2, 'abc'), false);
});

</script>
</html>
